<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户收藏管理</title>
	<meta name="decorator" content="default"/>
</head>
<body>
<div class="main-content">
    <tags:breadcrumb menuId="d13a995abb1f4a09bea8de9f03276f37" />
    <div class="page-content">
        <form:form id="inputForm" modelAttribute="userFavorite" action="" method="post" class="form-horizontal">
            <form:hidden path="id"/>
            <div class="form-group">
                <label class="col-sm-2 no-padding-right control-label">用户编号：</label>
                <div class="col-sm-4">
                    <tags:treeselect id="userId" name="userId" value="${userFavorite.userId}" labelName="" labelValue="${userFavorite.}"
                        title="用户" url="/sys/office/treeData?type=3" cssClass="" allowClear="true" notAllowSelectParent="true"/>
                </div>
            </div><hr>
            <div class="form-group">
                <label class="col-sm-2 no-padding-right control-label">收藏类型（volunteer，school，major）：</label>
                <div class="col-sm-4">
                    <form:input path="type" htmlEscape="false" maxlength="20" class="col-sm-10 "/>
                </div>
            </div><hr>
            <div class="form-group">
                <label class="col-sm-2 no-padding-right control-label">学校国标：</label>
                <div class="col-sm-4">
                    <form:input path="schoolCode" htmlEscape="false" maxlength="20" class="col-sm-10 "/>
                </div>
            </div><hr>
            <div class="form-group">
                <label class="col-sm-2 no-padding-right control-label">school_code_sn：</label>
                <div class="col-sm-4">
                    <form:input path="schoolCodeSn" htmlEscape="false" maxlength="20" class="col-sm-10 "/>
                </div>
            </div><hr>
            <div class="form-group">
                <label class="col-sm-2 no-padding-right control-label">组合编号：</label>
                <div class="col-sm-4">
                    <form:input path="volunteerId" htmlEscape="false" maxlength="32" class="col-sm-10 "/>
                </div>
            </div><hr>
            <div class="form-group">
                <label class="col-sm-2 no-padding-right control-label">专业国标：</label>
                <div class="col-sm-4">
                    <form:input path="majorCode" htmlEscape="false" maxlength="10" class="col-sm-10 "/>
                </div>
            </div><hr>
            <div class="form-group">
                <label class="col-sm-2 no-padding-right control-label">收藏时间：</label>
                <div class="col-sm-4">
                    <input name="favoriteTime" type="text" readonly="readonly" maxlength="20" class="col-sm-6 Wdate "
                        value="<fmt:formatDate value="${userFavorite.favoriteTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                </div>
            </div><hr>
            <div class="form-actions">
                <shiro:hasPermission name="user:userFavorite:edit"><input id="btnSubmit" class="btn btn-primary" type="button" value="保 存"/>&nbsp;</shiro:hasPermission>
                <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
            </div>
        </form:form>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#name").focus();
        $("#btnSubmit").click(function(){
            if($("#inputForm").valid()){
                var url = "${ctx}/user/userFavorite/save";
                $.post(url,$("#inputForm").serialize(),function(data){
                    if(data.success){
                        showNote("success",function(){
                            window.location.href = "${ctx}/user/userFavorite/list";
                        },data.msg,"center");
                    }else{
                        showNote("error",function(){return false;},data.msg,"center");
                    }
                });
            }else{
                showNote("error",function(){return false;},"输入有误，请正确输入数据","center");
            }
        });
    });
</script>
</body>
</html>